首先确定apt系统支持https URLs,具体为/usr/lib/apt/methods/https文件的存在,否则需要安装apt-transport-https包,命令为1234[ -e /usr/lib/apt/methods/https ] || { apt-get update apt-get install apt-transport-https}
然后,添加Docker仓库到本地keychain:1 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
最后更新apt-get,安装lxc-docker1234 sudo sh -c "echo deb https://get.docker.com/ubuntu docker main\> /etc/apt/sources.list.d/docker.list" sudo apt-get update sudo apt-get install lxc-docker
PS:
一个简单的curl命令也可以完成这项任务1 curl -sSL https://get.docker.com/ubuntu/ | sudo sh